# -*- coding: utf-8 -*-

'''eof
name:黑名单效验
code:Blacklist_Check
tableName:
columnName:
groups:准入>企业通用
dependencies:EG,BlackList
type:常用指标
datasourceType:在线指标
description:黑名单效验
eof'''

import sys

reload(sys)
sys.setdefaultencoding('utf-8')

# ratingRequest为请求参数,BlackList为黑名单列表


def blacklist_check():
    null_type_list = ['', None, 'null', 'Null', '/']
    try:
        blackList = BlackList["data"]
    except:
        return u'缺失值'

    try:
        if blackList not in null_type_list:
            if len(blackList) >= 1:
                return 1
            else:
                return 0
        else:
            return u'缺失值'
    except:
        return u'缺失值'


result = blacklist_check()
